package com.karashi.twitter.task;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import android.graphics.Bitmap;
import android.util.Log;

public class ImageCache {

	private static Map<String, Bitmap> cache = Collections.synchronizedMap(new HashMap<String, Bitmap>());

	public static Bitmap getImage(String key) {
		if (cache.containsKey(key)) {
			Log.d("cache", "cache hit!");
			return cache.get(key);
		}
		return null;
	}

	public static void setImage(String key, Bitmap bitmap) {
		cache.put(key, bitmap);
	}
}
